<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
	</head>

	<body style="background:#424242">
		<script src="../js/mui.js"></script>
		<script src="../js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript">
			mui.init()
			$.ajax({
				url: window.localStorage.getItem("url") + "home/getMyQuestion",
				data: {
					'uid': window.localStorage.getItem("u_id")
				},
				type: 'GET',
				dataType: 'JSON',
				contentType: "application/x-www-form-urlencoded; charset=UTF-8",
			
				cache: false,
				processData: true,
				success: function(data) {
					if (data != null) {
						var j = JSON.stringify(data);
						var jsondata = eval('(' + j + ')')
						//console.log( j[0].uid);
						$.each(jsondata, function(i, item) {
			
							var li =
								'<li class="mui-table-view-cell"><div class="mui-table"><div class="mui-table-cell mui-col-xs-10"><h4 class="mui-ellipsis">' +
								item.title + '</h4><h5 class="'+item.qid+'">' + item.describe + '</h5><p class="mui-h6 mui-ellipsis">提问者：' +
								item.uname +
								'</p></div><div class="mui-table-cell mui-col-xs-2 mui-text-right"><span class="mui-h5"></span></div></div></li>';
							$("#ul").append(li);
			
						});
			
					} else {
						mui.toast('不知道怎么肥事，不起作用了┐(´∇｀)┌');
					}
					var obj_lis = document.getElementById("ul").getElementsByTagName("h5");
					for (i = 0; i < obj_lis.length; i++) {
						obj_lis[i].onclick = function() {
							window.localStorage.setItem("qid", this.getAttribute("class"));
							mui.openWindow({
								url: './answer.html',
							});
						}
					}
			
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					//异常处理；
					alert(textStatus);
				}
			});
		</script>
		<div class="mui-content" id="pullrefresh">
			<ul id="ul" class="mui-table-view mui-table-view-striped mui-table-view-condensed">
		
			</ul>
		</div>
	</body>

</html>
